home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / X11 / imake.z / imake
Text File  |  1998-10-30  |  14KB  |  331 lines

  1.  
  2.  
  3.  
  4.      IIIIMMMMAAAAKKKKEEEE((((1111))))           XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111))))            IIIIMMMMAAAAKKKKEEEE((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           imake - C preprocessor interface to the make utility
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           iiiimmmmaaaakkkkeeee [ ----DDDD_d_e_f_i_n_e ] [ ----IIII_d_i_r ] [ ----TTTT_t_e_m_p_l_a_t_e ] [ ----ffff _f_i_l_e_n_a_m_e ]
  13.           [ ----CCCC _f_i_l_e_n_a_m_e ] [ ----ssss _f_i_l_e_n_a_m_e ] [ ----eeee ] [ ----vvvv ]
  14.  
  15.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.           _I_m_a_k_e is used to generate _M_a_k_e_f_i_l_e_s from a template, a set
  17.           of _c_p_p macro functions, and a per-directory input file
  18.           called an _I_m_a_k_e_f_i_l_e.  This allows machine dependencies (such
  19.           as compiler options, alternate command names, and special
  20.           _m_a_k_e rules) to be kept separate from the descriptions of the
  21.           various items to be built.
  22.  
  23.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  24.           The following command line options may be passed to _i_m_a_k_e:
  25.  
  26.           ----DDDD_d_e_f_i_n_e
  27.                   This option is passed directly to _c_p_p.  It is
  28.                   typically used to set directory-specific variables.
  29.                   For example, the X Window System uses this flag to
  30.                   set _T_O_P_D_I_R to the name of the directory containing
  31.                   the top of the core distribution and _C_U_R_D_I_R to the
  32.                   name of the current directory, relative to the top.
  33.  
  34.           ----IIII_d_i_r_e_c_t_o_r_y
  35.                   This option is passed directly to _c_p_p.  It is
  36.                   typically used to indicate the directory in which
  37.                   the _i_m_a_k_e template and configuration files may be
  38.                   found.
  39.  
  40.           ----TTTT_t_e_m_p_l_a_t_e
  41.                   This option specifies the name of the master
  42.                   template file (which is usually located in the
  43.                   directory specified with -_I) used by _c_p_p.  The
  44.                   default is _I_m_a_k_e._t_m_p_l.
  45.  
  46.           ----ffff _f_i_l_e_n_a_m_e
  47.                   This option specifies the name of the per-directory
  48.                   input file.  The default is _I_m_a_k_e_f_i_l_e.
  49.  
  50.           ----CCCC _f_i_l_e_n_a_m_e
  51.                   This option specifies the name of the .c file that
  52.                   is constructed in the current directory.  The
  53.                   default is _I_m_a_k_e_f_i_l_e._c.
  54.  
  55.           ----ssss _f_i_l_e_n_a_m_e
  56.                   This option specifies the name of the _m_a_k_e
  57.                   description file to be generated but _m_a_k_e should not
  58.                   be invoked.  If the _f_i_l_e_n_a_m_e is a dash (-), the
  59.                   output is written to _s_t_d_o_u_t.  The default is to
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      IIIIMMMMAAAAKKKKEEEE((((1111))))           XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111))))            IIIIMMMMAAAAKKKKEEEE((((1111))))
  71.  
  72.  
  73.  
  74.                   generate, but not execute, a _M_a_k_e_f_i_l_e.
  75.  
  76.           ----eeee      This option indicates the _i_m_a_k_e should execute the
  77.                   generated _M_a_k_e_f_i_l_e.  The default is to leave this to
  78.                   the user.
  79.  
  80.           ----vvvv      This option indicates that _i_m_a_k_e should print the
  81.                   _c_p_p command line that it is using to generate the
  82.                   _M_a_k_e_f_i_l_e.
  83.  
  84.      HHHHOOOOWWWW IIIITTTT WWWWOOOORRRRKKKKSSSS
  85.           _I_m_a_k_e invokes _c_p_p with any -_I or -_D flags passed on the
  86.           command line and passes the name of a file containing the
  87.           following 3 lines:
  88.  
  89.                     #define IMAKE_TEMPLATE "Imake.tmpl"
  90.                     #define INCLUDE_IMAKEFILE <Imakefile>
  91.                     #include IMAKE_TEMPLATE
  92.  
  93.           where _I_m_a_k_e._t_m_p_l and _I_m_a_k_e_f_i_l_e may be overridden by the -_T
  94.           and -_f command options, respectively.
  95.  
  96.           The IMAKE_TEMPLATE typically reads in a file containing
  97.           machine-dependent parameters (specified as _c_p_p symbols), a
  98.           site-specific parameters file, a file defining variables, a
  99.           file containing _c_p_p macro functions for generating _m_a_k_e
  100.           rules, and finally the _I_m_a_k_e_f_i_l_e (specified by
  101.           INCLUDE_IMAKEFILE) in the current directory.  The _I_m_a_k_e_f_i_l_e
  102.           uses the macro functions to indicate what targets should be
  103.           built; _i_m_a_k_e takes care of generating the appropriate rules.
  104.  
  105.           _I_m_a_k_e configuration files contain two types of variables,
  106.           imake variables and make variables.  The imake variables are
  107.           interpreted by cpp when _i_m_a_k_e is run.  By convention they
  108.           are mixed case.  The make variables are written into the
  109.           _M_a_k_e_f_i_l_e for later interpretation by _m_a_k_e. By convention
  110.           make variables are upper case.
  111.  
  112.           The rules file (usually named _I_m_a_k_e._r_u_l_e_s in the
  113.           configuration directory) contains a variety of _c_p_p macro
  114.           functions that are configured according to the current
  115.           platform.  _I_m_a_k_e replaces any occurrences of the string
  116.           ``@@'' with a newline to allow macros that generate more
  117.           than one line of _m_a_k_e rules. For example, the macro
  118.  
  119.           #define   program_target(program, objlist)        @@\
  120.           program:  objlist                                 @@\
  121.                     $(CC)  -o  $@  objlist  $(LDFLAGS)
  122.  
  123.           when called with _p_r_o_g_r_a_m__t_a_r_g_e_t(_f_o_o, _f_o_o_1._o  _f_o_o_2._o) will
  124.           expand to
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      IIIIMMMMAAAAKKKKEEEE((((1111))))           XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111))))            IIIIMMMMAAAAKKKKEEEE((((1111))))
  137.  
  138.  
  139.  
  140.           foo:      foo1.o  foo2.o
  141.                     $(CC)  -o  $@  foo1.o  foo2.o  $(LDFLAGS)
  142.  
  143.  
  144.           _I_m_a_k_e also replaces any occurrences of the word ``XCOMM''
  145.           with the character ``#'' to permit placing comments in the
  146.           Makefile without causing ``invalid directive'' errors from
  147.           the preprocessor.
  148.  
  149.           Some complex _i_m_a_k_e macros require generated _m_a_k_e variables
  150.           local to each invocation of the macro, often because their
  151.           value depends on parameters passed to the macro.  Such
  152.           variables can be created by using an _i_m_a_k_e variable of the
  153.           form XXXXVVVVAAAARRRRddddeeeeffff_n, where _n is a single digit.  A unique _m_a_k_e
  154.           variable will be substituted.  Later occurrences of the
  155.           variable XXXXVVVVAAAARRRRuuuusssseeee_n will be replaced by the variable created
  156.           by the corresponding XXXXVVVVAAAARRRRddddeeeeffff_n.
  157.  
  158.           On systems whose _c_p_p reduces multiple tabs and spaces to a
  159.           single space, _i_m_a_k_e attempts to put back any necessary tabs
  160.           (_m_a_k_e is very picky about the difference between tabs and
  161.           spaces).  For this reason, colons (:) in command lines must
  162.           be preceded by a backslash (\).
  163.  
  164.      UUUUSSSSEEEE WWWWIIIITTTTHHHH TTTTHHHHEEEE XXXX WWWWIIIINNNNDDDDOOOOWWWW SSSSYYYYSSSSTTTTEEEEMMMM
  165.           The X Window System uses _i_m_a_k_e extensively, for both full
  166.           builds within the source tree and external software.  As
  167.           mentioned above, two special variables, _T_O_P_D_I_R and _C_U_R_D_I_R,
  168.           are set to make referencing files using relative path names
  169.           easier.  For example, the following command is generated
  170.           automatically to build the _M_a_k_e_f_i_l_e in the directory _l_i_b/_X/
  171.           (relative to the top of the sources):
  172.  
  173.                     %  ../.././config/imake  -I../.././config  \
  174.                           -DTOPDIR=../../.   -DCURDIR=./lib/X
  175.  
  176.           When building X programs outside the source tree, a special
  177.           symbol _U_s_e_I_n_s_t_a_l_l_e_d is defined and _T_O_P_D_I_R and _C_U_R_D_I_R are
  178.           omitted.  If the configuration files have been properly
  179.           installed, the script _x_m_k_m_f(1) may be used.
  180.  
  181.      IIIINNNNPPPPUUUUTTTT FFFFIIIILLLLEEEESSSS
  182.           Here is a summary of the files read by _i_m_a_k_e as used by X.
  183.           The indentation shows what files include what other files.
  184.  
  185.               Imake.tmpl                generic variables
  186.                   site.def              site-specific, BeforeVendorCF defined
  187.                   *.cf                  machine-specific
  188.                       *Lib.rules        shared library rules
  189.                   site.def              site-specific, AfterVendorCF defined
  190.                   Imake.rules           rules
  191.                   X11.tmpl              X-specific variables
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      IIIIMMMMAAAAKKKKEEEE((((1111))))           XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111))))            IIIIMMMMAAAAKKKKEEEE((((1111))))
  203.  
  204.  
  205.  
  206.                       *Lib.tmpl         shared library variables
  207.                   Imakefile
  208.                       Library.tmpl      library rules
  209.                       Server.tmpl       server rules
  210.                       Threads.tmpl      multi-threaded rules
  211.  
  212.           Note that _s_i_t_e._d_e_f gets included twice, once before the *._c_f
  213.           file and once after.  Although most site customizations
  214.           should be specified after the *._c_f file, some, such as the
  215.           choice of compiler, need to be specified before, because
  216.           other variable settings may depend on them.
  217.  
  218.           The first time _s_i_t_e._d_e_f is included, the variable
  219.           BeforeVendorCF is defined, and the second time, the variable
  220.           AfterVendorCF is defined.  All code in _s_i_t_e._d_e_f should be
  221.           inside an #ifdef for one of these symbols.
  222.  
  223.      FFFFIIIILLLLEEEESSSS
  224.           Imakefile.c                   temporary input file for cpp
  225.           /tmp/Imf.XXXXXX               temporary Makefile for -s
  226.           /tmp/IIf.XXXXXX               temporary Imakefile if
  227.           specified Imakefile uses # comments
  228.           /lib/cpp                      default C preprocessor
  229.  
  230.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  231.           make(1), xmkmf(1)
  232.           S. I. Feldman, _M_a_k_e - _A _P_r_o_g_r_a_m _f_o_r _M_a_i_n_t_a_i_n_i_n_g _C_o_m_p_u_t_e_r
  233.           _P_r_o_g_r_a_m_s
  234.  
  235.      EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  236.           The following environment variables may be set, however
  237.           their use is not recommended as they introduce dependencies
  238.           that are not readily apparent when _i_m_a_k_e is run:
  239.  
  240.           IIIIMMMMAAAAKKKKEEEEIIIINNNNCCCCLLLLUUUUDDDDEEEE
  241.                If defined, this specifies a ``-I'' include argument to
  242.                pass to the C preprocessor.  E.g.,
  243.                ``-I/usr/X11/config''.
  244.  
  245.           IIIIMMMMAAAAKKKKEEEECCCCPPPPPPPP
  246.                If defined, this should be a valid path to a
  247.                preprocessor program.  E.g., ``/usr/local/cpp''.  By
  248.                default, _i_m_a_k_e will use /lib/cpp.
  249.  
  250.           IIIIMMMMAAAAKKKKEEEEMMMMAAAAKKKKEEEE
  251.                If defined, this should be a valid path to a make
  252.                program, such as ``/usr/local/make''.  By default,
  253.                _i_m_a_k_e will use whatever _m_a_k_e program is found using
  254.                _e_x_e_c_v_p(_3). This variable is only used if the ``-e''
  255.                option is specified.
  256.  
  257.      AAAAUUUUTTTTHHHHOOOORRRR
  258.  
  259.  
  260.  
  261.      PPPPaaaaggggeeee 4444                                          ((((pppprrrriiiinnnntttteeeedddd 4444////33330000////99998888))))
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      IIIIMMMMAAAAKKKKEEEE((((1111))))           XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111))))            IIIIMMMMAAAAKKKKEEEE((((1111))))
  269.  
  270.  
  271.  
  272.           Todd Brunhoff, Tektronix and MIT Project Athena; Jim Fulton,
  273.           MIT X Consortium
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 4/30/98)
  328.  
  329.  
  330.  
  331.